import 'package:flutter/material.dart';

class ABRightTopHollowCanvas extends StatelessWidget {
  final Widget? child;
  const ABRightTopHollowCanvas({Key? key,this.child}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return CustomPaint(
      painter: _ABRightTopHollowCanvasPainter(),
      child: child,
    );
  }
}

class _ABRightTopHollowCanvasPainter extends CustomPainter {
  @override
  void paint(Canvas canvas, Size size) {
    final paint = Paint()
      ..color = Colors.black
      ..style = PaintingStyle.stroke
      ..strokeWidth = 2;
    var hollowWidth = 160.0;
    final path = Path()
      ..moveTo(25, 0)
      ..lineTo(size.width - hollowWidth, 0)
      ..relativeCubicTo(30, 0, 10, 40, 40, 40)
      ..lineTo(size.width - 25, 40)
      ..relativeQuadraticBezierTo(25, 0, 23, 25)
      ..lineTo(size.width - 2, size.height)
      ..lineTo(2, size.height)
      ..lineTo(2, 27)
      ..relativeQuadraticBezierTo(0, -27, 25, -27);
    canvas.drawPath(path, paint);
  }

  @override
  bool shouldRepaint(covariant CustomPainter oldDelegate) {
    return true;
  }
}